<html>
<head><meta charset="utf-8"><title>Coercions of raw pointers in method resolution · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Coercions.20of.20raw.20pointers.20in.20method.20resolution.html">Coercions of raw pointers in method resolution</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="226149994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Coercions%20of%20raw%20pointers%20in%20method%20resolution/near/226149994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BN <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Coercions.20of.20raw.20pointers.20in.20method.20resolution.html#226149994">(Feb 12 2021 at 15:21)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/74679">#74679</a> requests that methods defined on raw slice pointers should be callable from raw array pointers. This currently fails because raw slice pointers are not treated as supertypes of raw array pointers by the type system. <span class="user-mention" data-user-id="120791">@RalfJ</span> wants this coercion to work for ergonomic reasons. </p>
<p>Would it be ok to coerce coercable raw pointer types when we check for candidates in <code>method::probe</code>, should we only output an error suggestion here or is there some other way to do this more elegantly besides coercions in <code>method::probe</code>?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>